HA$PBExportHeader$appmain.sra
$PBExportComments$Generated Application Object
forward
global type appmain from application
end type
global u_sqlca sqlca
global dynamicdescriptionarea sqlda
global dynamicstagingarea sqlsa
global error error
global message message
end forward

global variables
DataStore	gds_menu,gds_gmenu ,gds_modulo,gdc_mitem,gdc_mitem1,gdc_mitemalma,gdc_mitemalma1,gdc_mlistaprecio,gdc_mlistaprecio1
uo_logger log
string gs_usuario,gs_col1_uo_ddlb[] ,gs_LogId ,gs_host,gs_idUser,gs_Server,gs_Database,gs_rutaApp,gs_directorioActual,gs_rutaini="..\\RecursosApp.INI"
integer gi_iduser , gi_empresa=1

//DECALREA DE KEY
string gs_Unidad,gs_key
end variables

global type appmain from application
string appname = "appmain"
string dwmessagetitle = "Recursos y Aplicaciones SENDA"
end type
global appmain appmain

on appmain.create
appname="appmain"
message=create message
sqlca=create u_sqlca
sqlda=create dynamicdescriptionarea
sqlsa=create dynamicstagingarea
error=create error
end on

on appmain.destroy
destroy(sqlca)
destroy(sqlda)
destroy(sqlsa)
destroy(error)
destroy(message)
end on

event open;string ls_ruta

ls_ruta ="..\\RecursosApp.ini"
gs_rutaApp = ProfileString(ls_ruta , "ruta", "appPath", "")
gs_Unidad=gs_rutaApp


OpenWithParm(w_splash, "show")
//gs_key = 'AppRyA'
//
//Registryset( "HKEY_LOCAL_MACHINE\SoftWare\RecursosyAplicaciones\General","Key", gs_key)
//
//RegistryGet( "HKEY_LOCAL_MACHINE\SoftWare\RecursosyAplicaciones\General","unidad",gs_Unidad)
//if gs_Unidad = ''  or len(gs_Unidad)= 0 or isnull(gs_Unidad) then
//	gs_Unidad ='C:\APL_APP'
//	RegistrySet( "HKEY_LOCAL_MACHINE\Software\RecursosyAplicaciones\General","Unidad",gs_Unidad)
//end if

//ls_ruta =gs_Unidad +"\RecursosApp.INI"
//F_MSJ(GetCurrentDirectory() ,4)

//log = create uo_logger
//log.agregar_linea( 'Inicio de la Aplicaci$$HEX1$$f300$$ENDHEX$$n')

open(w_sysmain) 

//open(w_prueba_filestream)
end event

event systemerror;messagebox('error de sistema','power builder nro de error '+string(error.number))
//log.agregar_linea( 'power builder errornum'+string(error.number))
//log.agregar_linea( 'power builder message '+string(error.text))
//log.agregar_linea( 'power builder where '+string(error.windowmenu))
//log.agregar_linea( 'power builder object '+string(error.object))
//log.agregar_linea( 'power builder event '+string(error.objectevent))
//log.agregar_linea( 'power builder line'+string(error.line))
open(w_error)
end event

event close;//log.agregar_linea( 'Fin de la Aplicaci$$HEX1$$f300$$ENDHEX$$n')
end event

